import scrapy

from scrapy.selector import Selector

class NovelSpider(scrapy.Spider):
    name = 'novel'

    start_urls = ['http://www.akxs6.com/all.html']

    # parse
    def parse(self, response):
        #print('body',response.body)

        selector = Selector(response)

        # print(selector)
        books = selector.xpath("//li")

        for book in books:
            author = book.xpath("text()").extract_first()
            book_name = book.xpath("a/text()").extract_first()

            if author is not None: 
                yield {
                'author': author,
                'book_name': book_name
            }

        